{template 'common/header'}
<div class="main">
    <ul class="nav nav-tabs">
         <li{if $_GPC['do'] == 'post'} class="active"{/if}><a class="btn-lg" href="{php echo $this->createWebUrl('xyh_list',array('rid'=>$rid));}">幸运码管理</a></li>
    </ul>
	<div class="category">
	<div class="panel panel-default">
                <div class="panel-body table-responsive">
                    <table class="table table-hover">
                        <thead class="navbar-inner">
                        <tr>
                            <!--<th class='with-checkbox' style="width:50px;">-->
                                <!--<input type="checkbox" class="check_all" />-->
                            <!--</th>-->
                            <th style="width:200px;">幸运码</th>
                            <!--<th style="width:320px;">操作</th>-->
                        </tr>
                        </thead>
                        <tbody>
                        {loop $newlists $row}
                        <tr>
                            <!--<td class="with-checkbox"><input type="checkbox" name="check" value="{$row['id']}"></td>-->
                            <td>{$row['number']} </td>
                            <!--<td>-->
                                <!--<a class="btn btn-default" data-toggle="tooltip" data-placement="top" href="#" onclick="drop_confirm('您确定要删除吗?', '{php echo $this->createWebUrl('delete_xyhm',array('id'=>$list['id'],'pici'=>$row['pici']))}');" title="删除"><i class="fa fa-times"></i></a>-->
                            <!--</td>-->
                        </tr>
                        {/loop}
                        <!--<tr>-->
                            <!--<td colspan="7">-->
                                <!--<input type="button" class="btn btn-primary" name="deleteall" value="删除选择的" />-->
                            <!--</td>-->
                        <!--</tr>-->
                        </tbody>
                    </table>
                </div>
            </div>
	</div>

</div>

<script>
    require(['bootstrap'],function($){
        $('.btn').hover(function(){
            $(this).tooltip('show');
        },function(){
            $(this).tooltip('hide');
        });
    });



    $(function(){

        $(".check_all").click(function(){
            var checked = $(this).get(0).checked;

            $("input[type=checkbox]").attr("checked",checked);
        });
        $("input[name=deleteall]").click(function(){
            var check = $("input:checked");

            if(check.length<2){
                alert('请选择要删除的记录!');
                return false;
            }
            if( confirm("确认要删除选择的记录?")){
                var id = new Array();
                check.each(function(i){
                    id[i] = $(this).val();
                });
                $.post('{php echo $this->createWebUrl('deleteAllcard')}', {idArr:id},function(data){
                    if (data.errno ==0)
                    {
                        location.reload();
                    } else {
                        alert(data.error);
                    }


                },'json');
            }

        });
    });
</script>
<script>
    function drop_confirm(msg, url){
        if(confirm(msg)){
            window.location = url;
        }
    }
</script>
{$pager}
		
{template 'common/footer'}